<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Guiviewloader extends CI_Controller {


	function __construct()
	{
		parent::__construct();
		$this->load->helper(array('form', 'url'));
	}

	public function loadpage(){
		$page=$this->input->post("page",TRUE);
		$data['totalcharge']=$this->input->post("totalcharge",TRUE);
		$data['catid']=$page;
		
		if(is_numeric($page)){
			$this->load->view('itemsview',$data);
		}else{
			$this->load->view($page,$data);
		}
		
		
	}
	
	function fileupload()
	{
		$this->load->view('fileuploader', array('error' => ' ' ));
	}
	
	function do_upload()
	{
		$config['upload_path'] = './uploads/';
		$config['allowed_types'] = 'gif|jpg|png|JPEG|PNG|JPG|jpeg|GIF';
		$config['max_size']	= '1000';
		$config['max_width']  = '1024';
		$config['max_height']  = '768';
	
		$this->load->library('upload', $config);
			
		if ( ! $this->upload->do_upload())
		{
			echo $this->upload->display_errors();
		}
		else
		{
			echo "Upload Successfull";
		}
	}
}